package com.example.demo.service.impl;

import com.example.demo.dao.UserDAO;
import com.example.demo.model.User;
import com.example.demo.service.UserService;
import lombok.NonNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by xdkxlk on 2017/8/11.
 */
@Service
@Transactional
public class UserServiceImpl implements UserService {

    /*
    @Autowired
    @Resource
    @Qualifier
     */
    @Autowired
    private UserDAO userDAO;

    @Override
    public User getByName(@NonNull String name) {
        //对表A插入了一个数据
        //...
        //对表B插入了一个数据

        return this.userDAO.getByName(name);
    }
}
